<template>
  <el-card class="post-item">
    <div slot="header" class="clearfix">
      <el-tag type="danger" v-show="post.state===2">精品</el-tag>
      <el-tag type="primary" v-show="post.state===1">正常</el-tag>
      &nbsp;&nbsp;
      <router-link :to="'/post/detail/'+post.id">
        <span>{{ post.title }}</span>
      </router-link>
    </div>
    <div class="text item">
      <div class="post-item-info-name">
        <span>发帖人&nbsp;</span>
        <span>{{ post.name }}</span>
      </div>
      <div class="post-item-info-time" >
        <span>发帖时间&nbsp;</span>
        <span>{{ post.operateTime }}</span>
      </div>
    </div>
  </el-card>
</template>

<script>
export default {
  props: {
    post: {
      type: Object,
      default: null
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.post-item{
  margin-bottom: 20px;
  .text.item{
    display: flex;
    .post-item-info-name{
      margin-right: 40px;
    }
  }
}
</style>
